package common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zuolonglong
 * @version 1.0
 * @description
 * @date 2022/6/29
 */
public class InnerClassDemo {

    public static void main(String[] args) {
        List<Student.Address> list = new ArrayList<>();

        Student student = new Student();
        student.setName("smqk");

        list.add(student.new Address("湖北省", "武汉市"));
        list.add(student.new Address("湖北省", "孝感市"));
        list.add(student.new Address("湖北省", "广水市"));

        System.out.println(list);
    }

}

@Data
class Student {
    private String name;
    private String age;

    @Data
    @AllArgsConstructor
    @ToString
    public class Address {
        private String privince;
        private String city;
    }
}
